import { fetchMenuData } from './menu';

export async function getRoutes() {
  const menuData = await fetchMenuData();
  // 根据menuData生成路由
  const routes = menuData.map(item => ({
    path: item.path,
    component: item.component, // 假设每个菜单项都有对应的组件路径
    exact: true,
    name: item.name,
    icon: item.icon,
    authority: item.authority,
  }));

  return routes;
}
